﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraTab;
    using APP.HELPER;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using Common;
    using Extra.ERP;
    using Security.ERP;

    public class xucDisciplineAdd : Common.xucBaseAddH
    {
        private TextEdit cboDecideNumber;
        private TextEdit cboPerson;
        private ComboBoxEdit cboStatus;
        private IContainer components = null;
        private DateEdit dtDate;
        private DateEdit dtDateOccurred;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private GroupControl groupControl1;
        private GroupControl groupControl2;
        private LabelControl labelControl1;
        private LabelControl labelControl10;
        private LabelControl labelControl11;
        private LabelControl labelControl12;
        private LabelControl labelControl13;
        private LabelControl labelControl14;
        private LabelControl labelControl15;
        private LabelControl labelControl2;
        private LabelControl labelControl3;
        private LabelControl labelControl4;
        private LabelControl labelControl5;
        private LabelControl labelControl6;
        private LabelControl labelControl7;
        private LabelControl labelControl8;
        private LabelControl labelControl9;
        private LabelControl lbDisciplineCode;
        private RadioButton rdNo;
        private RadioButton rdNoKL;
        private RadioButton rdYes;
        private RadioButton rdYesKL;
        private MemoEdit txtDescription;
        private TextEdit txtDisciplineName;
        private ButtonEdit txtFilePath;
        private MemoEdit txtForm;
        private TextEdit txtID;
        private TextEdit txtLocation;
        private MemoEdit txtNotes;
        private MemoEdit txtReason;
        private TextEdit txtWitnesses;
        private XtraTabControl xtraTabControl1;
        private XtraTabPage xtraTabPage1;
        private XtraTabPage xtraTabPage2;

        public event SuccessEventHander Success;

        public xucDisciplineAdd()
        {
            this.InitializeComponent();
            this.InitComponent();
        }

        protected override void Add()
        {
            base.Add();
            this.txtID.Text = new HRM_DISCIPLINE().NewID();
            this.txtDisciplineName.Focus();
        }

        private void bnt_In_Click(object sender, EventArgs e)
        {
        }

        public void Clear()
        {
            this.txtDisciplineName.Text = "";
            this.txtReason.Text = "";
            this.txtForm.Text = "";
            this.txtLocation.Text = "";
            this.txtDescription.Text = "";
            this.txtWitnesses.Text = "";
            this.txtNotes.Text = "";
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        protected override void Init()
        {
        }

        private void InitComponent()
        {
            this.dtDate.DateTime = System.DateTime.Now;
            this.dtDateOccurred.DateTime = System.DateTime.Now;
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucDisciplineAdd));
            SerializableAppearanceObject appearance = new SerializableAppearanceObject();
            this.xtraTabControl1 = new XtraTabControl();
            this.xtraTabPage1 = new XtraTabPage();
            this.groupControl2 = new GroupControl();
            this.lbDisciplineCode = new LabelControl();
            this.txtID = new TextEdit();
            this.labelControl4 = new LabelControl();
            this.txtDisciplineName = new TextEdit();
            this.groupBox1 = new GroupBox();
            this.rdNo = new RadioButton();
            this.rdYes = new RadioButton();
            this.dtDateOccurred = new DateEdit();
            this.txtWitnesses = new TextEdit();
            this.txtLocation = new TextEdit();
            this.labelControl13 = new LabelControl();
            this.labelControl12 = new LabelControl();
            this.labelControl11 = new LabelControl();
            this.labelControl10 = new LabelControl();
            this.labelControl8 = new LabelControl();
            this.labelControl1 = new LabelControl();
            this.txtNotes = new MemoEdit();
            this.txtDescription = new MemoEdit();
            this.xtraTabPage2 = new XtraTabPage();
            this.groupControl1 = new GroupControl();
            this.groupBox2 = new GroupBox();
            this.rdNoKL = new RadioButton();
            this.rdYesKL = new RadioButton();
            this.labelControl2 = new LabelControl();
            this.labelControl3 = new LabelControl();
            this.labelControl14 = new LabelControl();
            this.dtDate = new DateEdit();
            this.txtFilePath = new ButtonEdit();
            this.labelControl9 = new LabelControl();
            this.labelControl5 = new LabelControl();
            this.labelControl7 = new LabelControl();
            this.labelControl6 = new LabelControl();
            this.txtForm = new MemoEdit();
            this.txtReason = new MemoEdit();
            this.cboDecideNumber = new TextEdit();
            this.cboPerson = new TextEdit();
            this.cboStatus = new ComboBoxEdit();
            this.labelControl15 = new LabelControl();
            ((ISupportInitialize) base.Err).BeginInit();
            base.imageCollection2.BeginInit();
            this.xtraTabControl1.BeginInit();
            this.xtraTabControl1.SuspendLayout();
            this.xtraTabPage1.SuspendLayout();
            this.groupControl2.BeginInit();
            this.groupControl2.SuspendLayout();
            this.txtID.Properties.BeginInit();
            this.txtDisciplineName.Properties.BeginInit();
            this.groupBox1.SuspendLayout();
            this.dtDateOccurred.Properties.VistaTimeProperties.BeginInit();
            this.dtDateOccurred.Properties.BeginInit();
            this.txtWitnesses.Properties.BeginInit();
            this.txtLocation.Properties.BeginInit();
            this.txtNotes.Properties.BeginInit();
            this.txtDescription.Properties.BeginInit();
            this.xtraTabPage2.SuspendLayout();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.dtDate.Properties.VistaTimeProperties.BeginInit();
            this.dtDate.Properties.BeginInit();
            this.txtFilePath.Properties.BeginInit();
            this.txtForm.Properties.BeginInit();
            this.txtReason.Properties.BeginInit();
            this.cboDecideNumber.Properties.BeginInit();
            this.cboPerson.Properties.BeginInit();
            this.cboStatus.Properties.BeginInit();
            base.SuspendLayout();
            base.btnSave.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            base.btnSave.Location = new Point(0x116, 0x133);
            base.btnSave.TabIndex = 2;
            base.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            base.btnCancel.Location = new Point(0x1dd, 0x133);
            base.btnCancel.TabIndex = 4;
            base.btnSaveNew.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            base.btnSaveNew.Location = new Point(0x178, 0x133);
            base.btnSaveNew.TabIndex = 3;
            base.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            this.xtraTabControl1.BorderStyle = BorderStyles.NoBorder;
            this.xtraTabControl1.Location = new Point(6, 3);
            this.xtraTabControl1.Name = "xtraTabControl1";
            this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
            this.xtraTabControl1.Size = new Size(0x23e, 0x127);
            this.xtraTabControl1.TabIndex = 0;
            this.xtraTabControl1.TabPages.AddRange(new XtraTabPage[] { this.xtraTabPage1, this.xtraTabPage2 });
            this.xtraTabPage1.Controls.Add(this.groupControl2);
            this.xtraTabPage1.Name = "xtraTabPage1";
            this.xtraTabPage1.Size = new Size(0x237, 0x10a);
            this.xtraTabPage1.Text = "M\x00f4 tả sự việc";
            this.groupControl2.BorderStyle = BorderStyles.NoBorder;
            this.groupControl2.Controls.Add(this.lbDisciplineCode);
            this.groupControl2.Controls.Add(this.txtID);
            this.groupControl2.Controls.Add(this.labelControl4);
            this.groupControl2.Controls.Add(this.txtDisciplineName);
            this.groupControl2.Controls.Add(this.groupBox1);
            this.groupControl2.Controls.Add(this.dtDateOccurred);
            this.groupControl2.Controls.Add(this.txtWitnesses);
            this.groupControl2.Controls.Add(this.txtLocation);
            this.groupControl2.Controls.Add(this.labelControl13);
            this.groupControl2.Controls.Add(this.labelControl12);
            this.groupControl2.Controls.Add(this.labelControl11);
            this.groupControl2.Controls.Add(this.labelControl10);
            this.groupControl2.Controls.Add(this.labelControl8);
            this.groupControl2.Controls.Add(this.labelControl1);
            this.groupControl2.Controls.Add(this.txtNotes);
            this.groupControl2.Controls.Add(this.txtDescription);
            this.groupControl2.Dock = DockStyle.Fill;
            this.groupControl2.Location = new Point(0, 0);
            this.groupControl2.Name = "groupControl2";
            this.groupControl2.Size = new Size(0x237, 0x10a);
            this.groupControl2.TabIndex = 0;
            this.groupControl2.Text = "Th\x00f4ng Tin Sự Việc";
            this.lbDisciplineCode.Location = new Point(0x19d, 11);
            this.lbDisciplineCode.Name = "lbDisciplineCode";
            this.lbDisciplineCode.Size = new Size(0x25, 13);
            this.lbDisciplineCode.TabIndex = 2;
            this.lbDisciplineCode.Text = "M\x00e3 đợt:";
            this.txtID.Location = new Point(0x1c8, 8);
            this.txtID.Name = "txtID";
            this.txtID.Size = new Size(0x65, 20);
            this.txtID.TabIndex = 3;
            this.txtID.EditValueChanged += new EventHandler(this.txtID_EditValueChanged);
            this.labelControl4.Location = new Point(10, 9);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new Size(0x6f, 13);
            this.labelControl4.TabIndex = 0;
            this.labelControl4.Text = "Bị xử l\x00fd kỷ luật về việc:";
            this.txtDisciplineName.Location = new Point(140, 7);
            this.txtDisciplineName.Name = "txtDisciplineName";
            this.txtDisciplineName.Size = new Size(0x10b, 20);
            this.txtDisciplineName.TabIndex = 1;
            this.groupBox1.Controls.Add(this.rdNo);
            this.groupBox1.Controls.Add(this.rdYes);
            this.groupBox1.Location = new Point(0x12e, 0x8e);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x100, 0x24);
            this.groupBox1.TabIndex = 13;
            this.groupBox1.TabStop = false;
            this.rdNo.AutoSize = true;
            this.rdNo.Location = new Point(0x7a, 12);
            this.rdNo.Name = "rdNo";
            this.rdNo.Size = new Size(0x37, 0x11);
            this.rdNo.TabIndex = 1;
            this.rdNo.Text = "Kh\x00f4ng";
            this.rdNo.UseVisualStyleBackColor = true;
            this.rdYes.AutoSize = true;
            this.rdYes.Checked = true;
            this.rdYes.Location = new Point(0x18, 13);
            this.rdYes.Name = "rdYes";
            this.rdYes.Size = new Size(0x26, 0x11);
            this.rdYes.TabIndex = 0;
            this.rdYes.TabStop = true;
            this.rdYes.Text = "C\x00f3";
            this.rdYes.UseVisualStyleBackColor = true;
            this.dtDateOccurred.EditValue = null;
            this.dtDateOccurred.Location = new Point(0x1c8, 120);
            this.dtDateOccurred.Name = "dtDateOccurred";
            this.dtDateOccurred.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtDateOccurred.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtDateOccurred.Size = new Size(0x66, 20);
            this.dtDateOccurred.TabIndex = 11;
            this.txtWitnesses.Location = new Point(140, 120);
            this.txtWitnesses.Name = "txtWitnesses";
            this.txtWitnesses.Size = new Size(0xe0, 20);
            this.txtWitnesses.TabIndex = 9;
            this.txtLocation.Location = new Point(140, 0x22);
            this.txtLocation.Name = "txtLocation";
            this.txtLocation.Size = new Size(0x1a1, 20);
            this.txtLocation.TabIndex = 5;
            this.labelControl13.Location = new Point(10, 180);
            this.labelControl13.Name = "labelControl13";
            this.labelControl13.Size = new Size(0x171, 13);
            this.labelControl13.TabIndex = 14;
            this.labelControl13.Text = "Nếu c\x00f3, n\x00eau r\x00f5 sự việc n\x00e0y vi phạm ch\x00ednh s\x00e1ch n\x00e0o v\x00e0 những vi phạm cụ thể.";
            this.labelControl12.Location = new Point(10, 0x9c);
            this.labelControl12.Name = "labelControl12";
            this.labelControl12.Size = new Size(0x116, 13);
            this.labelControl12.TabIndex = 12;
            this.labelControl12.Text = "Sự vệc n\x00e0y c\x00f3 vi phạm ch\x00ednh s\x00e1ch của c\x00f4ng ty hay kh\x00f4ng?";
            this.labelControl11.Location = new Point(10, 0x7b);
            this.labelControl11.Name = "labelControl11";
            this.labelControl11.Size = new Size(0x79, 13);
            this.labelControl11.TabIndex = 8;
            this.labelControl11.Text = "Những người chứng kiến:";
            this.labelControl10.Location = new Point(10, 0x3f);
            this.labelControl10.Name = "labelControl10";
            this.labelControl10.Size = new Size(0x73, 13);
            this.labelControl10.TabIndex = 6;
            this.labelControl10.Text = "M\x00f4 tả lại sự việc xảy ra:";
            this.labelControl8.Location = new Point(10, 0x25);
            this.labelControl8.Name = "labelControl8";
            this.labelControl8.Size = new Size(0x74, 13);
            this.labelControl8.TabIndex = 4;
            this.labelControl8.Text = "Địa điểm xảy ra sự việc:";
            this.labelControl1.Location = new Point(0x173, 0x7a);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(0x51, 13);
            this.labelControl1.TabIndex = 10;
            this.labelControl1.Text = "Thời gian xảy ra:";
            this.txtNotes.Location = new Point(8, 0xc7);
            this.txtNotes.Name = "txtNotes";
            this.txtNotes.Properties.Appearance.Options.UseTextOptions = true;
            this.txtNotes.Properties.Appearance.TextOptions.WordWrap = WordWrap.Wrap;
            this.txtNotes.Size = new Size(0x225, 0x33);
            this.txtNotes.TabIndex = 15;
            this.txtDescription.Location = new Point(140, 60);
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.Size = new Size(0x1a1, 0x34);
            this.txtDescription.TabIndex = 7;
            this.xtraTabPage2.Controls.Add(this.groupControl1);
            this.xtraTabPage2.Name = "xtraTabPage2";
            this.xtraTabPage2.Size = new Size(0x237, 0x10a);
            this.xtraTabPage2.Text = "H\x00ecnh thức kỷ luật";
            this.groupControl1.BorderStyle = BorderStyles.NoBorder;
            this.groupControl1.Controls.Add(this.groupBox2);
            this.groupControl1.Controls.Add(this.labelControl2);
            this.groupControl1.Controls.Add(this.labelControl3);
            this.groupControl1.Controls.Add(this.labelControl14);
            this.groupControl1.Controls.Add(this.dtDate);
            this.groupControl1.Controls.Add(this.txtFilePath);
            this.groupControl1.Controls.Add(this.labelControl9);
            this.groupControl1.Controls.Add(this.labelControl5);
            this.groupControl1.Controls.Add(this.labelControl7);
            this.groupControl1.Controls.Add(this.labelControl6);
            this.groupControl1.Controls.Add(this.txtForm);
            this.groupControl1.Controls.Add(this.txtReason);
            this.groupControl1.Controls.Add(this.cboDecideNumber);
            this.groupControl1.Controls.Add(this.cboPerson);
            this.groupControl1.Dock = DockStyle.Fill;
            this.groupControl1.Location = new Point(0, 0);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0x237, 0x10a);
            this.groupControl1.TabIndex = 0;
            this.groupControl1.Text = "Th\x00f4ng Tin Kỷ Luật";
            this.groupBox2.Controls.Add(this.rdNoKL);
            this.groupBox2.Controls.Add(this.rdYesKL);
            this.groupBox2.Location = new Point(0x161, 0x41);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new Size(0xca, 0x24);
            this.groupBox2.TabIndex = 3;
            this.groupBox2.TabStop = false;
            this.rdNoKL.AutoSize = true;
            this.rdNoKL.Location = new Point(0x72, 13);
            this.rdNoKL.Name = "rdNoKL";
            this.rdNoKL.Size = new Size(0x37, 0x11);
            this.rdNoKL.TabIndex = 1;
            this.rdNoKL.Text = "Kh\x00f4ng";
            this.rdNoKL.UseVisualStyleBackColor = true;
            this.rdYesKL.AutoSize = true;
            this.rdYesKL.Checked = true;
            this.rdYesKL.Location = new Point(0x17, 13);
            this.rdYesKL.Name = "rdYesKL";
            this.rdYesKL.Size = new Size(0x26, 0x11);
            this.rdYesKL.TabIndex = 0;
            this.rdYesKL.TabStop = true;
            this.rdYesKL.Text = "C\x00f3";
            this.rdYesKL.UseVisualStyleBackColor = true;
            this.labelControl2.Location = new Point(10, 0x65);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new Size(0x135, 13);
            this.labelControl2.TabIndex = 4;
            this.labelControl2.Text = "Người lao động c\x00f3 giải th\x00edch g\x00ec khi xảy ra sự việc? Nếu c\x00f3, ghi r\x00f5?";
            this.labelControl3.Location = new Point(9, 8);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(270, 13);
            this.labelControl3.TabIndex = 0;
            this.labelControl3.Text = "H\x00ecnh thức kỷ luật n\x00e0o được \x00e1p dụng cho người lao động?";
            this.labelControl14.Location = new Point(11, 0x4f);
            this.labelControl14.Name = "labelControl14";
            this.labelControl14.Size = new Size(0x14d, 13);
            this.labelControl14.TabIndex = 2;
            this.labelControl14.Text = "Đ\x00e3 giải th\x00edch c\x00e1c h\x00e0nh động vi phạm của người lao động cho họ chưa?";
            this.dtDate.EditValue = null;
            this.dtDate.Location = new Point(0x1cf, 0xc3);
            this.dtDate.Name = "dtDate";
            this.dtDate.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtDate.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtDate.Size = new Size(0x5d, 20);
            this.dtDate.TabIndex = 11;
            this.txtFilePath.Location = new Point(0x57, 0xe1);
            this.txtFilePath.Name = "txtFilePath";
            this.txtFilePath.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Glyph, "", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("txtFilePath.Properties.Buttons"), new KeyShortcut(Keys.None), appearance, "", "Browse", null, true) });
            this.txtFilePath.Properties.ButtonClick += new ButtonPressedEventHandler(this.txtFilePath_Properties_ButtonClick);
            this.txtFilePath.Size = new Size(0x1d5, 0x16);
            this.txtFilePath.TabIndex = 13;
            this.txtFilePath.Visible = false;
            this.labelControl9.Location = new Point(12, 0xc6);
            this.labelControl9.Name = "labelControl9";
            this.labelControl9.Size = new Size(70, 13);
            this.labelControl9.TabIndex = 6;
            this.labelControl9.Text = "Số quyết định:";
            this.labelControl5.Location = new Point(0x1ac, 0xc6);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(0x1d, 13);
            this.labelControl5.TabIndex = 10;
            this.labelControl5.Text = "Ng\x00e0y:";
            this.labelControl7.Location = new Point(12, 0xe5);
            this.labelControl7.Name = "labelControl7";
            this.labelControl7.Size = new Size(0x25, 13);
            this.labelControl7.TabIndex = 12;
            this.labelControl7.Text = "Tập tin:";
            this.labelControl7.Visible = false;
            this.labelControl6.Location = new Point(190, 0xc6);
            this.labelControl6.Name = "labelControl6";
            this.labelControl6.Size = new Size(80, 13);
            this.labelControl6.TabIndex = 8;
            this.labelControl6.Text = "Người ban h\x00e0nh:";
            this.txtForm.Location = new Point(8, 0x1b);
            this.txtForm.Name = "txtForm";
            this.txtForm.Size = new Size(0x223, 0x25);
            this.txtForm.TabIndex = 1;
            this.txtReason.Location = new Point(8, 120);
            this.txtReason.Name = "txtReason";
            this.txtReason.Size = new Size(0x223, 0x40);
            this.txtReason.TabIndex = 5;
            this.cboDecideNumber.Location = new Point(0x57, 0xc3);
            this.cboDecideNumber.Name = "cboDecideNumber";
            this.cboDecideNumber.Size = new Size(0x61, 20);
            this.cboDecideNumber.TabIndex = 7;
            this.cboPerson.Location = new Point(0x110, 0xc3);
            this.cboPerson.Name = "cboPerson";
            this.cboPerson.Size = new Size(150, 20);
            this.cboPerson.TabIndex = 9;
            this.cboStatus.EditValue = "L\x00ean kế hoạch";
            this.cboStatus.Location = new Point(0x5b, 310);
            this.cboStatus.Name = "cboStatus";
            this.cboStatus.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboStatus.Properties.Items.AddRange(new object[] { "L\x00ean kế hoạch", "Đang thực hiện", "Đ\x00e3 thực hiện" });
            this.cboStatus.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
            this.cboStatus.Size = new Size(0xa7, 20);
            this.cboStatus.TabIndex = 1;
            this.cboStatus.TabStop = false;
            this.labelControl15.AllowHtmlString = true;
            this.labelControl15.Location = new Point(14, 0x138);
            this.labelControl15.Name = "labelControl15";
            this.labelControl15.Size = new Size(70, 14);
            this.labelControl15.TabIndex = 0;
            this.labelControl15.Text = "Trạng th\x00e1i <color=red>(*)</color>:";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.labelControl15);
            base.Controls.Add(this.cboStatus);
            base.Controls.Add(this.xtraTabControl1);
            base.Name = "xucDisciplineAdd";
            base.Size = new Size(0x24a, 0x157);
            base.Controls.SetChildIndex(base.btnCancel, 0);
            base.Controls.SetChildIndex(base.btnSave, 0);
            base.Controls.SetChildIndex(base.btnSaveNew, 0);
            base.Controls.SetChildIndex(this.xtraTabControl1, 0);
            base.Controls.SetChildIndex(this.cboStatus, 0);
            base.Controls.SetChildIndex(this.labelControl15, 0);
            ((ISupportInitialize) base.Err).EndInit();
            base.imageCollection2.EndInit();
            this.xtraTabControl1.EndInit();
            this.xtraTabControl1.ResumeLayout(false);
            this.xtraTabPage1.ResumeLayout(false);
            this.groupControl2.EndInit();
            this.groupControl2.ResumeLayout(false);
            this.groupControl2.PerformLayout();
            this.txtID.Properties.EndInit();
            this.txtDisciplineName.Properties.EndInit();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.dtDateOccurred.Properties.VistaTimeProperties.EndInit();
            this.dtDateOccurred.Properties.EndInit();
            this.txtWitnesses.Properties.EndInit();
            this.txtLocation.Properties.EndInit();
            this.txtNotes.Properties.EndInit();
            this.txtDescription.Properties.EndInit();
            this.xtraTabPage2.ResumeLayout(false);
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.groupControl1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.dtDate.Properties.VistaTimeProperties.EndInit();
            this.dtDate.Properties.EndInit();
            this.txtFilePath.Properties.EndInit();
            this.txtForm.Properties.EndInit();
            this.txtReason.Properties.EndInit();
            this.cboDecideNumber.Properties.EndInit();
            this.cboPerson.Properties.EndInit();
            this.cboStatus.Properties.EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        private void RaiseSuccessEventHander(HRM_DISCIPLINE item)
        {
            if (this.Success != null)
            {
                this.Success(this, item);
            }
        }

        public void SetData(HRM_DISCIPLINE item)
        {
            SYS_LOG.Insert("Qu\x00e1 Tr\x00ecnh Kỷ Luật", "Xem", this.txtID.Text);
            if (base.m_Status == Actions.Update)
            {
                this.txtID.Properties.ReadOnly = true;
            }
            this.txtID.Text = item.DisciplineCode;
            this.txtDisciplineName.Text = item.DisciplineName;
            this.txtReason.Text = item.Reason;
            this.txtForm.Text = item.Form;
            this.cboDecideNumber.Text = item.DecideNumber;
            this.dtDate.DateTime = item.Date;
            this.cboPerson.Text = item.Person;
            this.txtFilePath.Text = item.FilePath;
            this.dtDateOccurred.DateTime = item.DateOccurred;
            this.txtLocation.Text = item.Location;
            this.txtDescription.Text = item.Description;
            this.txtWitnesses.Text = item.Witnesses;
            if (item.Violations.ToString() == "True")
            {
                this.rdYes.Checked = true;
            }
            else
            {
                this.rdNo.Checked = true;
            }
            this.txtNotes.Text = item.Notes;
            if (item.Settlement.ToString() == "True")
            {
                this.rdYesKL.Checked = true;
            }
            else
            {
                this.rdNoKL.Checked = true;
            }
            this.cboStatus.SelectedIndex = item.Status;
        }

        private void txtFilePath_Properties_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog {
                Filter = "All File(*.*)|*.*",
                FilterIndex = 0
            };
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                this.txtFilePath.Text = dialog.FileName;
            }
        }

        private void txtID_EditValueChanged(object sender, EventArgs e)
        {
            TextEdit control = (TextEdit) sender;
            if (control.ErrorText != string.Empty)
            {
                base.Err.SetError(control, string.Empty);
            }
            if (base.m_Status == Actions.Add)
            {
                HRM_DISCIPLINE hrm_discipline = new HRM_DISCIPLINE();
                if (hrm_discipline.Exist(control.Text))
                {
                    base.Err.SetError(control, "M\x00e3 đ\x00e3 tồn tại.");
                    control.Focus();
                }
            }
        }

        protected override string uc_Change()
        {
            return string.Empty;
        }

        protected override string uc_Delete()
        {
            HRM_DISCIPLINE item = new HRM_DISCIPLINE {
                DisciplineCode = this.txtID.Text
            };
            string str = item.Delete();
            if (str == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            return str;
        }

        protected override string uc_Save()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiDiscipline") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowAdd)
            {
                MyRule.Notify();
                return "";
            }
            SYS_LOG.Insert("Qu\x00e1 Tr\x00ecnh Kỷ Luật", "Th\x00eam", this.txtID.Text);
            base.SetWaitDialogCaption("Đang lưu dữ liệu...");
            Cursor.Current = Cursors.WaitCursor;
            HRM_DISCIPLINE item = new HRM_DISCIPLINE {
                DisciplineCode = this.txtID.Text,
                DisciplineName = this.txtDisciplineName.Text,
                Reason = this.txtReason.Text,
                Form = this.txtForm.Text,
                Date = this.dtDate.DateTime,
                DecideNumber = this.cboDecideNumber.Text,
                Person = this.cboPerson.Text,
                FilePath = this.txtFilePath.Text,
                DateOccurred = this.dtDateOccurred.DateTime,
                Location = this.txtLocation.Text,
                Description = this.txtDescription.Text,
                Witnesses = this.txtWitnesses.Text
            };
            if (this.rdYes.Checked)
            {
                item.Violations = true;
            }
            else
            {
                item.Violations = false;
            }
            item.Notes = this.txtNotes.Text;
            if (this.rdYesKL.Checked)
            {
                item.Settlement = true;
            }
            else
            {
                item.Settlement = false;
            }
            item.Status = this.cboStatus.SelectedIndex;
            string text = item.Insert();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            Cursor.Current = Cursors.Default;
            this.DoHide();
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            return text;
        }

        protected override string uc_Update()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiDiscipline") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowEdit)
            {
                MyRule.Notify();
                return "";
            }
            SYS_LOG.Insert("Qu\x00e1 Tr\x00ecnh Kỷ Luật", "Cập Nhật", this.txtID.Text);
            base.SetWaitDialogCaption("Đang cập nhật dữ liệu...");
            HRM_DISCIPLINE item = new HRM_DISCIPLINE {
                DisciplineCode = this.txtID.Text,
                DisciplineName = this.txtDisciplineName.Text,
                Reason = this.txtReason.Text,
                Form = this.txtForm.Text,
                Date = this.dtDate.DateTime,
                DecideNumber = this.cboDecideNumber.Text,
                Person = this.cboPerson.Text,
                FilePath = this.txtFilePath.Text,
                DateOccurred = this.dtDateOccurred.DateTime,
                Location = this.txtLocation.Text,
                Description = this.txtDescription.Text,
                Witnesses = this.txtWitnesses.Text
            };
            if (this.rdYes.Checked)
            {
                item.Violations = true;
            }
            else
            {
                item.Violations = false;
            }
            item.Notes = this.txtNotes.Text;
            if (this.rdYesKL.Checked)
            {
                item.Settlement = true;
            }
            else
            {
                item.Settlement = false;
            }
            item.Status = this.cboStatus.SelectedIndex;
            string text = item.Update();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            this.DoHide();
            return text;
        }

        public delegate void SuccessEventHander(object sender, HRM_DISCIPLINE item);
    }
}

